home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / os2 / ticker2.zip / scripts / quote.cmd < prev    next >
OS/2 REXX Batch file  |  1996-05-22  |  836b  |  42 lines

  1. /* script to randomly display a  quote */
  2.  
  3. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  4. call SysLoadFuncs
  5.  
  6. /* call addTicker 'debug1', DEBUG1, -3, black */
  7.  
  8. maxquotes = 999
  9.  
  10. arg filename 
  11.  
  12. if (filename = '') then
  13.   filename = 'scripts\quote.txt'
  14.  
  15. /* if you now how many quotes are in the file, than change 
  16.    the following line to quotenr = random(NROFQUOTES) */
  17. quotenr = random(maxquotes)
  18. quotefound = 0
  19. quoteline = ''
  20.  
  21. do while lines(filename) 
  22.   aline = linein(filename)
  23.  
  24.   if (quotefound = quotenr) then
  25.     quoteline = quoteline' 'aline
  26.  
  27.   if (aline = '') then 
  28.     quotefound = quotefound + 1
  29.  
  30.   if (\ (lines(filename))) then
  31.   do
  32.     if (quotefound < maxquotes) then 
  33.       aline = linein(filename,1,0)
  34.  
  35.   end
  36.  
  37. end
  38.  
  39. call addTicker ' 'quoteline' ', 'QUOTE', 0, yellow
  40.  
  41. exit
  42.